package com.cafe.case6;
/**
 *
 * @author cafe
 * @version 1.0
 * @date 2025-01-23 21:00:00
 */

public class LoopDemo {
    public static void main(String[] args) {
        int size = 500;
        System.out.println("开始运行");
        for (int i = 0; i < size; i++) {
            doSth();
            System.out.print("进度：" + (i + 1) + "/" + size + "\r");
        }
        System.out.println();
        System.out.println("结束运行");
    }

    private static void doSth() {
        try {
            Thread.sleep(10);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}

